<?php

use Hyperf\Database\Schema\Schema;
use Hyperf\Database\Schema\Blueprint;
use Hyperf\Database\Migrations\Migration;

class CreateAdminTable extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::create('admin', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->string('head_img')->nullable()->comment('头像');
            $table->string('nickname', 50)->comment('昵称');
            $table->string('username', 50)->comment('用户名');
            $table->string('password')->comment('密码');
            $table->string('mobile', 25)->nullable()->comment('手机号');
            $table->string('email', 50)->nullable()->comment('邮箱');
            $table->unsignedTinyInteger('is_admin')->default(0)->comment('是否为超管|["否","是"]');
            $table->unsignedTinyInteger('status')->default(1)->comment('状态|{"1":"启用","2":"未启用","3":"冻结"}');
            $table->timestampsTz();
            $table->softDeletesTz();
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::dropIfExists('admin');
    }
}
